@import "./color.less";
html,
body,
#app,
div,
span,
a,
p,
h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  padding: 0;
  // font-size: 0.38rem;
  // color: #5a5a5a;
  //   background: white;
}

// 报错页面
.error-page {
  position: fixed;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: 10000;
  top: 0;
  left: 0;
  text-align: center;
  .error-box {
    width: 50%;
    top: 25%;
    text-align: center;
    position: absolute;
    left: 25%;
    // margin: auto;
    font-size: 16px;
    font-weight: bold;
    color: #0094ff;
    img {
      width: 100%;
      margin-bottom: 0.5rem;
    }
  }
}
.loading-icon {
  margin-bottom: 25px;
}

// 遮罩层
.mask {
  position: fixed;
  z-index: 2;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

// 鼠标悬停有下划线
.xiahuaxian {
  position: relative;
  &:hover:after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    bottom: 0;
    border-bottom: 1px solid #409eff;
  }
}

.hidden {
  // display: none隐藏后的元素不占据任何空间
  // visibility: hidden隐藏后的元素空间依旧保留
  display: none;
}

// 空页面
.is-empty {
  width: 30%;
  margin: 45% auto 0;
  text-align: center;
  img {
    width: 100%;
  }
  p {
    margin-top: 40px;
    color: #999;
  }
}

// 文字不换行
.nowrap {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

// 设置元素为flex元素
.flex {
  display: flex;
  -webkit-display: flex;
}

// 用在设置弹性盒子的子元素超出换行，默认不换行
.flex-wrap {
  flex-wrap: wrap;
  -webkit-flex-wrap: wrap;
}

// 设置垂直方向居中，需要配合flex属性使用
.align-c {
  align-items: center;
  -webkit-align-items: center;
}

// 每个项目两侧的间隔相等
.flex-a:extend(.flex, .align-c) {
  justify-content: space-around;
  -webkit-justify-content: space-around;
}

// 两端对齐
.flex-b:extend(.flex, .align-c) {
  justify-content: space-between;
  -webkit-justify-content: space-between;
}

// 居中对齐
.flex-c:extend(.flex, .align-c) {
  justify-content: center;
  -webkit-justify-content: center;
}

// 方向变为垂直
.flex-d:extend(.flex) {
  flex-direction: column;
}

// 开始对齐
.flex-s:extend(.flex, .align-c) {
  justify-content: flex-start;
  -webkit-justify-content: flex-start;
}

// 结束对齐
.flex-e:extend(.flex, .align-c) {
  justify-content: flex-end;
  -webkit-justify-content: flex-end;
}

img {
  max-width: 100%;
}

.whole:extend(.h-100, .w-100) {
  box-sizing: border-box;
  // background:skyblue;
  // width: 100%;
  // height: 100%;
}

.h-100 {
  height: 100%;
}

.w-100 {
  width: 100%;
}

.pos-center {
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
}

.divider {
  width: 100%;
  height: 26px;
  background: #f3f4f5;
}

.btn {
  width: 6rem;
  height: 1.2rem;
  line-height: 1.2rem;
  background-color: @main;
  color: #fff;
  font-size: 34px;
  text-align: center;
  margin: 20px auto;
  border-radius: 40px;
  box-shadow: 1px 2px 8px @main;
}

.text-l {
  text-align: left;
}

.text-c {
  text-align: center;
}

.text-r {
  text-align: right;
}

.gray {
  color: #999;
}

// 标题类的tab，以及激活状态，加伪元素
.tab-item {
  // margin-left: 25px;
  // flex: 1;
  // width: 20%;
  width: 55px;
  position: relative;
  height: 23px;
  line-height: 23px;
  text-align: center;
  font-size: 12px;
  font-family: PingFang SC;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(24, 110, 223, 0.7);
  border-radius: 12px;
  &:not(:last-child) {
    margin-right: 15px;
  }
}
// 选中的状态
.active {
  width: 70px;
  font-size: 14px;
  font-family: PingFang SC;
  font-weight: bold;
  color: #ffffff;
  opacity: 1;
  position: relative;
  // 添加的伪元素位置在底部
  &::before {
    content: "";
    display: block;
    width: 65px;
    height: 3px;
    background: #ffffff;
    border-radius: 4px;
    // background: red;
    position: absolute;
    bottom: -12px;
    left: 5%;
  }
}

// 卡片类的布局,有边框阴影
.card1 {
  margin-bottom: 15px;
  font-size: 14px;
  box-shadow: 0px 0px 8px 0px rgba(157, 162, 175, 0.31);
  border-radius: 5px;
  padding: 19px;
}

// 添加的伪元素，位置在右侧
// 父元素需要定位，还需要设置父元素的宽度
// 剩余的样式需要自己调节
.weibot {
  // border: 1px solid #000;
  position: relative;
  &::before {
    content: "";
    display: block;
    width: 2px;
    height: 10px;
    position: absolute;
    top: 100%;
    right: -7%;
    margin-top: -10px;
    background: #aaaaaa;
  }
}

.tianxie {
  border: 1px solid #f2f2f2;
  padding: 0px 5px;
  height: 25px;
  line-height: 25px;
  border-radius: 0px 3px 3px 0px;
  font-size: 12px;
  &.active2 {
    background: #51a9ff;
    font-weight: bold;
    color: aliceblue;
  }
  &:first-child {
    border-right: 0px;
    border-radius: 3px 0px 0px 3px;
  }
}
